<?php
// include_once '_database_env_localhost.php';

include_once '_functions.php';

$ip = get_client_ip();

$ip_header = explode('.', $ip)[0];

const LCOAL_IP_HEADERS = [127, 192, 172, 10, 20];

$is_localhost = in_array($ip_header, LCOAL_IP_HEADERS, false);

if ($is_localhost) {
  // include_once '_database_env_localhost.php';
  define('DB_HOST', 'localhost');
  define('DB_PORT', '3306');
  define('DB_USER', 'cdapp');
  define('DB_PASSWD', 'gzzxjjwt1');
  define('DB_NAME', 'cdapp');
} else {
  // include_once '_database_env_aliyun.php';
  define('DB_HOST', 'cdm823323580.my3w.com');
  define('DB_PORT', '3306');
  define('DB_USER', 'cdm823323580');
  define('DB_PASSWD', 'Inctu2012036');
  define('DB_NAME', 'cdm823323580_db');
}
